// 廷议管理项目中用户相关的接口
import request from '@/utils/request'
import type {
  loginForm,
  loginResponseData,
  userResponseData,
  userLogout,
  userLogoutSuccessInfo,
} from './type'

// 统一管理接口
enum API {
  LOGIN_API = '/admin/acl/index/login',
  USERINFO_URL = '/admin/acl/index/info',
  LOGOUT_API = '/admin/acl/index/logout',
}

// 暴露请求函数
// 登录接口方法
export const reqLogin = (data: loginForm) =>
  request.post<any, loginResponseData>(API.LOGIN_API, data)
// 获取用户信息接口方法
export const reqUserInfo = () =>
  request.get<any, userResponseData>(API.USERINFO_URL)
// 退出登录
export const reqLogout = (data: userLogout) => {
  request.post<any, userLogoutSuccessInfo>(API.LOGOUT_API, data)
}
